<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ page import="crm.model.Notice" %>
<%@ page import="crm.control.NoticeControl"%>
<%@ page import="java.util.*"  %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>修改公告通知</title>
  </head>
  
  <body>
    		<%
				request.setCharacterEncoding("UTF-8");
				NoticeControl nc = new NoticeControl();
				int id = Integer.parseInt(request.getParameter("id"));
				String theme = request.getParameter("theme");
				String time = request.getParameter("time");
				int writer = Integer.parseInt(request.getParameter("writer")); 
				String content = request.getParameter("content");				
				
				Notice notice = new Notice();
				notice.setTheme(theme);
				notice.setTime(time);
				notice.setWriter(writer);
				notice.setContent(content);
				
				if (nc.updateNotice(notice, id)) {
					//System.out.println(nc.updateNews(news,id));
		%>
	 <script language = "javascript">
if(window.confirm("更新成功！"))
window.top.location.href = "notice.jsp";
else
window.top.location.href = "notice.jsp";
</script>
<%} else { %>
<script language="javascript">
if(window.confirm("更新失败！"))
window.top.location.href = "notice.jsp";
else
window.top.location.href = "notice.jsp";
</script>
		<%
	  		}
		%>
  </body>
</html>
